import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Vector;


public interface ServerAPI extends Remote
{
	Pair<Boolean, Integer> joinGame(Boolean mainServer) throws RemoteException;
	StartGameStatus waitToPlay(int id, int myPort) throws RemoteException;
	Pair<Boolean, GameStatus> move(int id, int direction) throws RemoteException;
	
	
/////////////////////////////////////////////////////////////////////////////////////////////////
/////      
/////      Functions related to ensuring stability (during crashes)
/////
/////////////////////////////////////////////////////////////////////////////////////////////////
	
	
	void printIdentity(int serverType, int id) throws RemoteException;
	void setNewServer(ServerAPI stub, int serverType) throws RemoteException;
	void assignServerAsBackUp(int port, String registryBindString) throws RemoteException;	
	void updateBackUpBegin(GameStatus gameStatus, Vector<ServerInformation> serverInfo) throws RemoteException;
	Pair<Integer, Integer> updateBackUpmove(int id, int direction) throws RemoteException;
	boolean isMainServerAlive() throws RemoteException;
	boolean isBackUpServerAlive() throws RemoteException;
	void updateBackUppSynchronised(GameStatus gs, Vector<ServerInformation> si, boolean hasCrashed) throws RemoteException;
	void isServerAlive() throws RemoteException;
}
